import { mapState } from "vuex"
import './index.less'

export default {
  data () {
    return {
      baseList: [
        {
          label: '全部',
          value: ''
        }
      ],
      list: []
    }
  },
  computed: {

  },
  created () {
  },
  mounted () {
    // this.getBoardAndCategoryList()
  },
  methods: {
    handleClick (node, index) {
      this.list.splice(index)
      this.$emit('select', node)
    },
    addNode (node) {
      this.list.push({
        label: node.name,
        value: node.id
      })
    }
  },
  render (h) {
    const {
      baseList,
      list,
      handleClick
    } = this
    const arr = [...baseList, ...list]
    return (
      <div class="breadcrumb">
        {
          arr.map((item, index) => {
            return (
              <div class="item">
                <span onClick={() => handleClick(item, index)} class="label">{item.label}</span>
                <span class="line">/</span>
              </div>
            )
          })
        }
      </div>

    )
  }
}
